<!doctype html public "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
<html>
<head>
<title>
JSJaC Overview
</title>
<link rel ="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script>
function asd() {
	
		parent.document.title="crypt.js Overview";
	
}
</script>
</head>
<body bgcolor="white" onload="asd();">

<!-- ========== START OF NAVBAR ========== -->
<a name="navbar_top"><!-- --></a>
<table border="0" width="100%" cellpadding="1" cellspacing="0">
<tr>
<td colspan=2 bgcolor="#EEEEFF" class="NavBarCell1">
<a name="navbar_top_firstrow"><!-- --></a>
<table border="0" cellpadding="0" cellspacing="3">
  <tr align="center" valign="top">
  
  
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-summary.html"><font class="NavBarFont1"><b>Overview</b></font></a>&nbsp;</td>
  <td bgcolor="#FFFFFF" class="NavBarCell1Rev">	&nbsp;<font class="NavBarFont1Rev"><b>File</b></font>&nbsp;</td>
  

  <td bgcolor="#FFFFFF" class="NavBarCell1"> 	<font class="NavBarFont1">Class</font>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-tree.html"><font class="NavBarFont1"><b>Tree</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="index-all.html"--><font class="NavBarFont1"><b>Index</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="help-doc.html"><font class="NavBarFont1"><b>Help</b></font></a>&nbsp;</td>
  </tr>
</table>
</td>
<td bgcolor="#EEEEFF" align="right" valign="top">
<em>
<b>JSJaC</b></em>
</td>
</tr>

<tr>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
&nbsp;PREV&nbsp;
&nbsp;NEXT</font></td>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
  <a href="index.html" target="_top"><b>FRAMES</b></a>  &nbsp;
&nbsp;<a href="overview-summary.html" target="_top"><b>NO FRAMES</b></a>
&nbsp;&nbsp;
<script>
  <!--
  if(window==top) {
    document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
  }
  //-->
</script>
<noscript>
<a href="allclasses-noframe.html" target=""><b>All Classes</b></a>
</noscript>
</font></td>
</tr>
</table>
<!-- =========== END OF NAVBAR =========== -->

<hr>
<center>
	
	   <h2>crypt.js</h2>
	
</center>

	


<h4>Summary</h4>
<p>
	
		Collection of MD5 and SHA1 hashing and encoding
 methods.
 <BR/><BR/><B>Version: </B>$Revision: 437 $<BR/><BR/><B>Author:</B> Stefan Strigler steve@zeank.in-berlin.de
 <BR/>
	
</p>

<hr>



<!-- ========== METHOD SUMMARY =========== -->

	<a name="method_summary"><!-- --></a>
	<table border="1" cellpadding="3" cellspacing="0" width="100%">
		<tr bgcolor="#CCCCFF" class="TableHeadingColor">
			<td colspan=2>
				<font size="+2">
					<b>Method Summary</b>
				</font>
			</td>
		</tr>
	
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;Object</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!b64_hmac_md5">b64_hmac_md5</a></b>(key, data)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;Object</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!b64_hmac_sha1">b64_hmac_sha1</a></b>(key, data)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;Object</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!b64_md5">b64_md5</a></b>(s)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;Object</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!b64_sha1">b64_sha1</a></b>(s)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;void</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!b64arrays">b64arrays</a></b>()
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;Object</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!b64d2t">b64d2t</a></b>(d)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;Object</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!b64t2d">b64t2d</a></b>(t)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;Object</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!binb2b64">binb2b64</a></b>(binarray)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;Object</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!binb2hex">binb2hex</a></b>(binarray)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;Object</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!binb2str">binb2str</a></b>(bin)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;Object</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!binl2b64">binl2b64</a></b>(binarray)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;Object</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!binl2hex">binl2hex</a></b>(binarray)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;Object</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!binl2str">binl2str</a></b>(bin)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;Object</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!bit_rol">bit_rol</a></b>(num, cnt)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;Object</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!cnonce">cnonce</a></b>(size)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;Object</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!core_hmac_md5">core_hmac_md5</a></b>(key, data)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;Object</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!core_hmac_sha1">core_hmac_sha1</a></b>(key, data)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;Object</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!core_md5">core_md5</a></b>(x, len)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;Object</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!core_sha1">core_sha1</a></b>(x, len)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;Object</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!hex_hmac_md5">hex_hmac_md5</a></b>(key, data)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;Object</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!hex_hmac_sha1">hex_hmac_sha1</a></b>(key, data)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;Object</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!hex_md5">hex_md5</a></b>(s)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;Object</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!hex_sha1">hex_sha1</a></b>(s)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;Object</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!md5_cmn">md5_cmn</a></b>(q, a, b, x, s, t)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;Object</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!md5_ff">md5_ff</a></b>(a, b, c, d, x, s, t)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;Object</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!md5_gg">md5_gg</a></b>(a, b, c, d, x, s, t)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;Object</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!md5_hh">md5_hh</a></b>(a, b, c, d, x, s, t)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;Object</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!md5_ii">md5_ii</a></b>(a, b, c, d, x, s, t)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;Object</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!md5_vm_test">md5_vm_test</a></b>()
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;Object</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!rol">rol</a></b>(num, cnt)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;Object</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!safe_add">safe_add</a></b>(x, y)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;Object</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!sha1_ft">sha1_ft</a></b>(t, b, c, d)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;Object</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!sha1_kt">sha1_kt</a></b>(t)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;Object</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!sha1_vm_test">sha1_vm_test</a></b>()
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;Object</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!str2binb">str2binb</a></b>(str)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;Object</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!str2binl">str2binl</a></b>(str)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;Object</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!str_hmac_md5">str_hmac_md5</a></b>(key, data)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;Object</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!str_hmac_sha1">str_hmac_sha1</a></b>(key, data)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;Object</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!str_md5">str_md5</a></b>(s)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;Object</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!str_sha1">str_sha1</a></b>(s)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;Object</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!utf8d2t">utf8d2t</a></b>(d)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;Object</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!utf8t2d">utf8t2d</a></b>(t)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
	
	</table>
    <p>

<!-- ========== END METHOD SUMMARY =========== -->


        <pre class="sourceview"><span class="comment">/* Copyright (c) 1998 - 2007, Paul Johnston &amp; Contributors
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following
 * disclaimer. Redistributions in binary form must reproduce the above
 * copyright notice, this list of conditions and the following
 * disclaimer in the documentation and/or other materials provided
 * with the distribution.
 *
 * Neither the name of the author nor the names of its contributors
 * may be used to endorse or promote products derived from this
 * software without specific prior written permission.
 *
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 * OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 */</span>

<span class="comment">/**
 * <span class="attrib">@fileoverview</span> Collection of MD5 and SHA1 hashing and encoding
 * methods.
 * <span class="attrib">@author</span> Stefan Strigler steve<span class="attrib">@zeank</span>.in-berlin.de
 * <span class="attrib">@version</span> $Revision: 437 $
 */</span>

<span class="comment">/*
 * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
 * in FIPS PUB 180-1
 * Version 2.1a Copyright Paul Johnston 2000 - 2002.
 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
 * Distributed under the BSD License
 * See http://pajhome.org.uk/crypt/md5 for details.
 */</span>

<span class="comment">/*
 * Configurable variables. You may need to tweak these to be compatible with
 * the server-side, but the defaults work in most cases.
 */</span>
var hexcase = 0;  <span class="comment">/* hex output format. 0 - lowercase; 1 - uppercase        */</span>
var b64pad  = <span class="literal">"="</span>; <span class="comment">/* base-64 pad character. "=" for strict RFC compliance   */</span>
var chrsz   = 8;  <span class="comment">/* bits per input character. 8 - ASCII; 16 - Unicode      */</span>

<span class="comment">/*
 * These are the functions you'll usually want to call
 * They take string arguments and return either hex or base-64 encoded strings
 */</span>
<span class="reserved">function</span> hex_sha1(s){<span class="reserved">return</span> binb2hex(core_sha1(str2binb(s),s.length * chrsz));}
<span class="reserved">function</span> b64_sha1(s){<span class="reserved">return</span> binb2b64(core_sha1(str2binb(s),s.length * chrsz));}
<span class="reserved">function</span> str_sha1(s){<span class="reserved">return</span> binb2str(core_sha1(str2binb(s),s.length * chrsz));}
<span class="reserved">function</span> hex_hmac_sha1(key, data){ <span class="reserved">return</span> binb2hex(core_hmac_sha1(key, data));}
<span class="reserved">function</span> b64_hmac_sha1(key, data){ <span class="reserved">return</span> binb2b64(core_hmac_sha1(key, data));}
<span class="reserved">function</span> str_hmac_sha1(key, data){ <span class="reserved">return</span> binb2str(core_hmac_sha1(key, data));}

<span class="comment">/*
 * Perform a simple self-test to see if the VM is working
 */</span>
<span class="reserved">function</span> sha1_vm_test()
{
  <span class="reserved">return</span> hex_sha1(<span class="literal">"abc"</span>) == <span class="literal">"a9993e364706816aba3e25717850c26c9cd0d89d"</span>;
}

<span class="comment">/*
 * Calculate the SHA-1 of an array of big-endian words, and a bit length
 */</span>
<span class="reserved">function</span> core_sha1(x, len)
{
  <span class="comment">/* append padding */</span>
  x[len &gt;&gt; 5] |= 0x80 &lt;&lt; (24 - len % 32);
  x[((len + 64 &gt;&gt; 9) &lt;&lt; 4) + 15] = len;

  var w = Array(80);
  var a =  1732584193;
  var b = -271733879;
  var c = -1732584194;
  var d =  271733878;
  var e = -1009589776;

  <span class="reserved">for</span>(var i = 0; i &lt; x.length; i += 16)
    {
      var olda = a;
      var oldb = b;
      var oldc = c;
      var oldd = d;
      var olde = e;

      <span class="reserved">for</span>(var j = 0; j &lt; 80; j++)
        {
          <span class="reserved">if</span>(j &lt; 16) w[j] = x[i + j];
          <span class="reserved">else</span> w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1);
          var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)),
                           safe_add(safe_add(e, w[j]), sha1_kt(j)));
          e = d;
          d = c;
          c = rol(b, 30);
          b = a;
          a = t;
        }

      a = safe_add(a, olda);
      b = safe_add(b, oldb);
      c = safe_add(c, oldc);
      d = safe_add(d, oldd);
      e = safe_add(e, olde);
    }
  <span class="reserved">return</span> Array(a, b, c, d, e);

}

<span class="comment">/*
 * Perform the appropriate triplet combination function for the current
 * iteration
 */</span>
<span class="reserved">function</span> sha1_ft(t, b, c, d)
{
  <span class="reserved">if</span>(t &lt; 20) <span class="reserved">return</span> (b &amp; c) | ((~b) &amp; d);
  <span class="reserved">if</span>(t &lt; 40) <span class="reserved">return</span> b ^ c ^ d;
  <span class="reserved">if</span>(t &lt; 60) <span class="reserved">return</span> (b &amp; c) | (b &amp; d) | (c &amp; d);
  <span class="reserved">return</span> b ^ c ^ d;
}

<span class="comment">/*
 * Determine the appropriate additive constant for the current iteration
 */</span>
<span class="reserved">function</span> sha1_kt(t)
{
  <span class="reserved">return</span> (t &lt; 20) ?  1518500249 : (t &lt; 40) ?  1859775393 :
    (t &lt; 60) ? -1894007588 : -899497514;
}

<span class="comment">/*
 * Calculate the HMAC-SHA1 of a key and some data
 */</span>
<span class="reserved">function</span> core_hmac_sha1(key, data)
{
  var bkey = str2binb(key);
  <span class="reserved">if</span>(bkey.length &gt; 16) bkey = core_sha1(bkey, key.length * chrsz);

  var ipad = Array(16), opad = Array(16);
  <span class="reserved">for</span>(var i = 0; i &lt; 16; i++)
    {
      ipad[i] = bkey[i] ^ 0x36363636;
      opad[i] = bkey[i] ^ 0x5C5C5C5C;
    }

  var hash = core_sha1(ipad.concat(str2binb(data)), 512 + data.length * chrsz);
  <span class="reserved">return</span> core_sha1(opad.concat(hash), 512 + 160);
}

<span class="comment">/*
 * Bitwise rotate a 32-bit number to the left.
 */</span>
<span class="reserved">function</span> rol(num, cnt)
{
  <span class="reserved">return</span> (num &lt;&lt; cnt) | (num &gt;&gt;&gt; (32 - cnt));
}

<span class="comment">/*
 * Convert an 8-bit or 16-bit string to an array of big-endian words
 * In 8-bit function, characters &gt;255 have their hi-byte silently ignored.
 */</span>
<span class="reserved">function</span> str2binb(str)
{
  var bin = Array();
  var mask = (1 &lt;&lt; chrsz) - 1;
  <span class="reserved">for</span>(var i = 0; i &lt; str.length * chrsz; i += chrsz)
    bin[i&gt;&gt;5] |= (str.charCodeAt(i / chrsz) &amp; mask) &lt;&lt; (32 - chrsz - i%32);
  <span class="reserved">return</span> bin;
}

<span class="comment">/*
 * Convert an array of big-endian words to a string
 */</span>
<span class="reserved">function</span> binb2str(bin)
{
  var str = <span class="literal">""</span>;
  var mask = (1 &lt;&lt; chrsz) - 1;
  <span class="reserved">for</span>(var i = 0; i &lt; bin.length * 32; i += chrsz)
    str += String.fromCharCode((bin[i&gt;&gt;5] &gt;&gt;&gt; (32 - chrsz - i%32)) &amp; mask);
  <span class="reserved">return</span> str;
}

<span class="comment">/*
 * Convert an array of big-endian words to a hex string.
 */</span>
<span class="reserved">function</span> binb2hex(binarray)
{
  var hex_tab = hexcase ? <span class="literal">"0123456789ABCDEF"</span> : <span class="literal">"0123456789abcdef"</span>;
  var str = <span class="literal">""</span>;
  <span class="reserved">for</span>(var i = 0; i &lt; binarray.length * 4; i++)
    {
      str += hex_tab.charAt((binarray[i&gt;&gt;2] &gt;&gt; ((3 - i%4)*8+4)) &amp; 0xF) +
        hex_tab.charAt((binarray[i&gt;&gt;2] &gt;&gt; ((3 - i%4)*8  )) &amp; 0xF);
    }
  <span class="reserved">return</span> str;
}

<span class="comment">/*
 * Convert an array of big-endian words to a base-64 string
 */</span>
<span class="reserved">function</span> binb2b64(binarray)
{
  var tab = <span class="literal">"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"</span>;
  var str = <span class="literal">""</span>;
  <span class="reserved">for</span>(var i = 0; i &lt; binarray.length * 4; i += 3)
    {
      var triplet = (((binarray[i   &gt;&gt; 2] &gt;&gt; 8 * (3 -  i   %4)) &amp; 0xFF) &lt;&lt; 16)
        | (((binarray[i+1 &gt;&gt; 2] &gt;&gt; 8 * (3 - (i+1)%4)) &amp; 0xFF) &lt;&lt; 8 )
        |  ((binarray[i+2 &gt;&gt; 2] &gt;&gt; 8 * (3 - (i+2)%4)) &amp; 0xFF);
      <span class="reserved">for</span>(var j = 0; j &lt; 4; j++)
        {
          <span class="reserved">if</span>(i * 8 + j * 6 &gt; binarray.length * 32) str += b64pad;
          <span class="reserved">else</span> str += tab.charAt((triplet &gt;&gt; 6*(3-j)) &amp; 0x3F);
        }
    }
  <span class="reserved">return</span> str;
}

<span class="comment">/*
 * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
 * Digest Algorithm, as defined in RFC 1321.
 * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002.
 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
 * Distributed under the BSD License
 * See http://pajhome.org.uk/crypt/md5 for more info.
 */</span>

<span class="comment">/*
 * Configurable variables. You may need to tweak these to be compatible with
 * the server-side, but the defaults work in most cases.
 */</span>
<span class="comment">// var hexcase = 0;  /* hex output format. 0 - lowercase; 1 - uppercase        */</span>
<span class="comment">// var b64pad  = ""; /* base-64 pad character. "=" for strict RFC compliance   */</span>
<span class="comment">// var chrsz   = 8;  /* bits per input character. 8 - ASCII; 16 - Unicode      */</span>

<span class="comment">/*
 * These are the functions you'll usually want to call
 * They take string arguments and return either hex or base-64 encoded strings
 */</span>
<span class="reserved">function</span> hex_md5(s){ <span class="reserved">return</span> binl2hex(core_md5(str2binl(s), s.length * chrsz));}
<span class="reserved">function</span> b64_md5(s){ <span class="reserved">return</span> binl2b64(core_md5(str2binl(s), s.length * chrsz));}
<span class="reserved">function</span> str_md5(s){ <span class="reserved">return</span> binl2str(core_md5(str2binl(s), s.length * chrsz));}
<span class="reserved">function</span> hex_hmac_md5(key, data) { <span class="reserved">return</span> binl2hex(core_hmac_md5(key, data)); }
<span class="reserved">function</span> b64_hmac_md5(key, data) { <span class="reserved">return</span> binl2b64(core_hmac_md5(key, data)); }
<span class="reserved">function</span> str_hmac_md5(key, data) { <span class="reserved">return</span> binl2str(core_hmac_md5(key, data)); }

<span class="comment">/*
 * Perform a simple self-test to see if the VM is working
 */</span>
<span class="reserved">function</span> md5_vm_test()
{
  <span class="reserved">return</span> hex_md5(<span class="literal">"abc"</span>) == <span class="literal">"900150983cd24fb0d6963f7d28e17f72"</span>;
}

<span class="comment">/*
 * Calculate the MD5 of an array of little-endian words, and a bit length
 */</span>
<span class="reserved">function</span> core_md5(x, len)
{
  <span class="comment">/* append padding */</span>
  x[len &gt;&gt; 5] |= 0x80 &lt;&lt; ((len) % 32);
  x[(((len + 64) &gt;&gt;&gt; 9) &lt;&lt; 4) + 14] = len;

  var a =  1732584193;
  var b = -271733879;
  var c = -1732584194;
  var d =  271733878;

  <span class="reserved">for</span>(var i = 0; i &lt; x.length; i += 16)
  {
    var olda = a;
    var oldb = b;
    var oldc = c;
    var oldd = d;

    a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);
    d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);
    c = md5_ff(c, d, a, b, x[i+ 2], 17,  606105819);
    b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);
    a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);
    d = md5_ff(d, a, b, c, x[i+ 5], 12,  1200080426);
    c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);
    b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);
    a = md5_ff(a, b, c, d, x[i+ 8], 7 ,  1770035416);
    d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);
    c = md5_ff(c, d, a, b, x[i+10], 17, -42063);
    b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);
    a = md5_ff(a, b, c, d, x[i+12], 7 ,  1804603682);
    d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);
    c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);
    b = md5_ff(b, c, d, a, x[i+15], 22,  1236535329);

    a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);
    d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
    c = md5_gg(c, d, a, b, x[i+11], 14,  643717713);
    b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);
    a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);
    d = md5_gg(d, a, b, c, x[i+10], 9 ,  38016083);
    c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);
    b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);
    a = md5_gg(a, b, c, d, x[i+ 9], 5 ,  568446438);
    d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);
    c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);
    b = md5_gg(b, c, d, a, x[i+ 8], 20,  1163531501);
    a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);
    d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);
    c = md5_gg(c, d, a, b, x[i+ 7], 14,  1735328473);
    b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);

    a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);
    d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);
    c = md5_hh(c, d, a, b, x[i+11], 16,  1839030562);
    b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);
    a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);
    d = md5_hh(d, a, b, c, x[i+ 4], 11,  1272893353);
    c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);
    b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);
    a = md5_hh(a, b, c, d, x[i+13], 4 ,  681279174);
    d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);
    c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);
    b = md5_hh(b, c, d, a, x[i+ 6], 23,  76029189);
    a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);
    d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);
    c = md5_hh(c, d, a, b, x[i+15], 16,  530742520);
    b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);

    a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);
    d = md5_ii(d, a, b, c, x[i+ 7], 10,  1126891415);
    c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);
    b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);
    a = md5_ii(a, b, c, d, x[i+12], 6 ,  1700485571);
    d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);
    c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);
    b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);
    a = md5_ii(a, b, c, d, x[i+ 8], 6 ,  1873313359);
    d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);
    c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);
    b = md5_ii(b, c, d, a, x[i+13], 21,  1309151649);
    a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);
    d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);
    c = md5_ii(c, d, a, b, x[i+ 2], 15,  718787259);
    b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);

    a = safe_add(a, olda);
    b = safe_add(b, oldb);
    c = safe_add(c, oldc);
    d = safe_add(d, oldd);
  }
  <span class="reserved">return</span> Array(a, b, c, d);

}

<span class="comment">/*
 * These functions implement the four basic operations the algorithm uses.
 */</span>
<span class="reserved">function</span> md5_cmn(q, a, b, x, s, t)
{
  <span class="reserved">return</span> safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);
}
<span class="reserved">function</span> md5_ff(a, b, c, d, x, s, t)
{
  <span class="reserved">return</span> md5_cmn((b &amp; c) | ((~b) &amp; d), a, b, x, s, t);
}
<span class="reserved">function</span> md5_gg(a, b, c, d, x, s, t)
{
  <span class="reserved">return</span> md5_cmn((b &amp; d) | (c &amp; (~d)), a, b, x, s, t);
}
<span class="reserved">function</span> md5_hh(a, b, c, d, x, s, t)
{
  <span class="reserved">return</span> md5_cmn(b ^ c ^ d, a, b, x, s, t);
}
<span class="reserved">function</span> md5_ii(a, b, c, d, x, s, t)
{
  <span class="reserved">return</span> md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
}

<span class="comment">/*
 * Calculate the HMAC-MD5, of a key and some data
 */</span>
<span class="reserved">function</span> core_hmac_md5(key, data)
{
  var bkey = str2binl(key);
  <span class="reserved">if</span>(bkey.length &gt; 16) bkey = core_md5(bkey, key.length * chrsz);

  var ipad = Array(16), opad = Array(16);
  <span class="reserved">for</span>(var i = 0; i &lt; 16; i++)
  {
    ipad[i] = bkey[i] ^ 0x36363636;
    opad[i] = bkey[i] ^ 0x5C5C5C5C;
  }

  var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);
  <span class="reserved">return</span> core_md5(opad.concat(hash), 512 + 128);
}

<span class="comment">/*
 * Add integers, wrapping at 2^32. This uses 16-bit operations internally
 * to work around bugs in some JS interpreters.
 */</span>
<span class="reserved">function</span> safe_add(x, y)
{
  var lsw = (x &amp; 0xFFFF) + (y &amp; 0xFFFF);
  var msw = (x &gt;&gt; 16) + (y &gt;&gt; 16) + (lsw &gt;&gt; 16);
  <span class="reserved">return</span> (msw &lt;&lt; 16) | (lsw &amp; 0xFFFF);
}

<span class="comment">/*
 * Bitwise rotate a 32-bit number to the left.
 */</span>
<span class="reserved">function</span> bit_rol(num, cnt)
{
  <span class="reserved">return</span> (num &lt;&lt; cnt) | (num &gt;&gt;&gt; (32 - cnt));
}

<span class="comment">/*
 * Convert a string to an array of little-endian words
 * If chrsz is ASCII, characters &gt;255 have their hi-byte silently ignored.
 */</span>
<span class="reserved">function</span> str2binl(str)
{
  var bin = Array();
  var mask = (1 &lt;&lt; chrsz) - 1;
  <span class="reserved">for</span>(var i = 0; i &lt; str.length * chrsz; i += chrsz)
    bin[i&gt;&gt;5] |= (str.charCodeAt(i / chrsz) &amp; mask) &lt;&lt; (i%32);
  <span class="reserved">return</span> bin;
}

<span class="comment">/*
 * Convert an array of little-endian words to a string
 */</span>
<span class="reserved">function</span> binl2str(bin)
{
  var str = <span class="literal">""</span>;
  var mask = (1 &lt;&lt; chrsz) - 1;
  <span class="reserved">for</span>(var i = 0; i &lt; bin.length * 32; i += chrsz)
    str += String.fromCharCode((bin[i&gt;&gt;5] &gt;&gt;&gt; (i % 32)) &amp; mask);
  <span class="reserved">return</span> str;
}

<span class="comment">/*
 * Convert an array of little-endian words to a hex string.
 */</span>
<span class="reserved">function</span> binl2hex(binarray)
{
  var hex_tab = hexcase ? <span class="literal">"0123456789ABCDEF"</span> : <span class="literal">"0123456789abcdef"</span>;
  var str = <span class="literal">""</span>;
  <span class="reserved">for</span>(var i = 0; i &lt; binarray.length * 4; i++)
  {
    str += hex_tab.charAt((binarray[i&gt;&gt;2] &gt;&gt; ((i%4)*8+4)) &amp; 0xF) +
           hex_tab.charAt((binarray[i&gt;&gt;2] &gt;&gt; ((i%4)*8  )) &amp; 0xF);
  }
  <span class="reserved">return</span> str;
}

<span class="comment">/*
 * Convert an array of little-endian words to a base-64 string
 */</span>
<span class="reserved">function</span> binl2b64(binarray)
{
  var tab = <span class="literal">"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"</span>;
  var str = <span class="literal">""</span>;
  <span class="reserved">for</span>(var i = 0; i &lt; binarray.length * 4; i += 3)
  {
    var triplet = (((binarray[i   &gt;&gt; 2] &gt;&gt; 8 * ( i   %4)) &amp; 0xFF) &lt;&lt; 16)
                | (((binarray[i+1 &gt;&gt; 2] &gt;&gt; 8 * ((i+1)%4)) &amp; 0xFF) &lt;&lt; 8 )
                |  ((binarray[i+2 &gt;&gt; 2] &gt;&gt; 8 * ((i+2)%4)) &amp; 0xFF);
    <span class="reserved">for</span>(var j = 0; j &lt; 4; j++)
    {
      <span class="reserved">if</span>(i * 8 + j * 6 &gt; binarray.length * 32) str += b64pad;
      <span class="reserved">else</span> str += tab.charAt((triplet &gt;&gt; 6*(3-j)) &amp; 0x3F);
    }
  }
  <span class="reserved">return</span> str;
}

<span class="comment">/* #############################################################################
   UTF-8 Decoder and Encoder
   base64 Encoder and Decoder
   written by Tobias Kieslich, justdreams
   Contact: tobias<span class="attrib">@justdreams</span>.de				http://www.justdreams.de/
   ############################################################################# */</span>

<span class="comment">// returns an array of byterepresenting dezimal numbers which represent the</span>
<span class="comment">// plaintext in an UTF-8 encoded version. Expects a string.</span>
<span class="comment">// This function includes an exception management for those nasty browsers like</span>
<span class="comment">// NN401, which returns negative decimal numbers for chars&gt;128. I hate it!!</span>
<span class="comment">// This handling is unfortunately limited to the user's charset. Anyway, it works</span>
<span class="comment">// in most of the cases! Special signs with an unicode&gt;256 return numbers, which</span>
<span class="comment">// can not be converted to the actual unicode and so not to the valid utf-8</span>
<span class="comment">// representation. Anyway, this function does always return values which can not</span>
<span class="comment">// misinterpretd by RC4 or base64 en- or decoding, because every value is &gt;0 and</span>
<span class="comment">// &lt;255!!</span>
<span class="comment">// Arrays are faster and easier to handle in b64 encoding or encrypting....</span>
<span class="reserved">function</span> utf8t2d(t)
{
  t = t.replace(/\r\n/g,<span class="literal">"\n"</span>);
  var d=new Array; var test=String.fromCharCode(237);
  <span class="reserved">if</span> (test.charCodeAt(0) &lt; 0)
    <span class="reserved">for</span>(var n=0; n&lt;t.length; n++)
      {
        var c=t.charCodeAt(n);
        <span class="reserved">if</span> (c&gt;0)
          d[d.length]= c;
        <span class="reserved">else</span> {
          d[d.length]= (((256+c)&gt;&gt;6)|192);
          d[d.length]= (((256+c)&amp;63)|128);}
      }
  <span class="reserved">else</span>
    <span class="reserved">for</span>(var n=0; n&lt;t.length; n++)
      {
        var c=t.charCodeAt(n);
        <span class="comment">// all the signs of asci =&gt; 1byte</span>
        <span class="reserved">if</span> (c&lt;128)
          d[d.length]= c;
        <span class="comment">// all the signs between 127 and 2047 =&gt; 2byte</span>
        <span class="reserved">else</span> <span class="reserved">if</span>((c&gt;127) &amp;&amp; (c&lt;2048)) {
          d[d.length]= ((c&gt;&gt;6)|192);
          d[d.length]= ((c&amp;63)|128);}
        <span class="comment">// all the signs between 2048 and 66536 =&gt; 3byte</span>
        <span class="reserved">else</span> {
          d[d.length]= ((c&gt;&gt;12)|224);
          d[d.length]= (((c&gt;&gt;6)&amp;63)|128);
          d[d.length]= ((c&amp;63)|128);}
      }
  <span class="reserved">return</span> d;
}
	
<span class="comment">// returns plaintext from an array of bytesrepresenting dezimal numbers, which</span>
<span class="comment">// represent an UTF-8 encoded text; browser which does not understand unicode</span>
<span class="comment">// like NN401 will show "?"-signs instead</span>
<span class="comment">// expects an array of byterepresenting decimals; returns a string</span>
<span class="reserved">function</span> utf8d2t(d)
{
  var r=new Array; var i=0;
  <span class="reserved">while</span>(i&lt;d.length)
    {
      <span class="reserved">if</span> (d[i]&lt;128) {
        r[r.length]= String.fromCharCode(d[i]); i++;}
      <span class="reserved">else</span> <span class="reserved">if</span>((d[i]&gt;191) &amp;&amp; (d[i]&lt;224)) {
        r[r.length]= String.fromCharCode(((d[i]&amp;31)&lt;&lt;6) | (d[i+1]&amp;63)); i+=2;}
      <span class="reserved">else</span> {
        r[r.length]= String.fromCharCode(((d[i]&amp;15)&lt;&lt;12) | ((d[i+1]&amp;63)&lt;&lt;6) | (d[i+2]&amp;63)); i+=3;}
    }
  <span class="reserved">return</span> r.join(<span class="literal">""</span>);
}

<span class="comment">// included in &lt;body onload="b64arrays"&gt; it creates two arrays which makes base64</span>
<span class="comment">// en- and decoding faster</span>
<span class="comment">// this speed is noticeable especially when coding larger texts (&gt;5k or so)</span>
<span class="reserved">function</span> b64arrays() {
  var b64s=<span class="literal">'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'</span>;
  b64 = new Array();f64 =new Array();
  <span class="reserved">for</span> (var i=0; i&lt;b64s.length ;i++) {
    b64[i] = b64s.charAt(i);
    f64[b64s.charAt(i)] = i;
  }
}

<span class="comment">// creates a base64 encoded text out of an array of byerepresenting dezimals</span>
<span class="comment">// it is really base64 :) this makes serversided handling easier</span>
<span class="comment">// expects an array; returns a string</span>
<span class="reserved">function</span> b64d2t(d) {
  var r=new Array; var i=0; var dl=d.length;
  <span class="comment">// this is for the padding</span>
  <span class="reserved">if</span> ((dl%3) == 1) {
    d[d.length] = 0; d[d.length] = 0;}
  <span class="reserved">if</span> ((dl%3) == 2)
    d[d.length] = 0;
  <span class="comment">// from here conversion</span>
  <span class="reserved">while</span> (i&lt;d.length)
    {
      r[r.length] = b64[d[i]&gt;&gt;2];
      r[r.length] = b64[((d[i]&amp;3)&lt;&lt;4) | (d[i+1]&gt;&gt;4)];
      r[r.length] = b64[((d[i+1]&amp;15)&lt;&lt;2) | (d[i+2]&gt;&gt;6)];
      r[r.length] = b64[d[i+2]&amp;63];
      i+=3;
    }
  <span class="comment">// this is again for the padding</span>
  <span class="reserved">if</span> ((dl%3) == 1)
    r[r.length-1] = r[r.length-2] = <span class="literal">"="</span>;
  <span class="reserved">if</span> ((dl%3) == 2)
    r[r.length-1] = <span class="literal">"="</span>;
  <span class="comment">// we join the array to return a textstring</span>
  var t=r.join(<span class="literal">""</span>);
  <span class="reserved">return</span> t;
}

<span class="comment">// returns array of byterepresenting numbers created of an base64 encoded text</span>
<span class="comment">// it is still the slowest function in this modul; I hope I can make it faster</span>
<span class="comment">// expects string; returns an array</span>
<span class="reserved">function</span> b64t2d(t) {
  var d=new Array; var i=0;
  <span class="comment">// here we fix this CRLF sequenz created by MS-OS; arrrgh!!!</span>
  t=t.replace(/\n|\r/g,<span class="literal">""</span>); t=t.replace(/=/g,<span class="literal">""</span>);
  <span class="reserved">while</span> (i&lt;t.length)
    {
      d[d.length] = (f64[t.charAt(i)]&lt;&lt;2) | (f64[t.charAt(i+1)]&gt;&gt;4);
      d[d.length] = (((f64[t.charAt(i+1)]&amp;15)&lt;&lt;4) | (f64[t.charAt(i+2)]&gt;&gt;2));
      d[d.length] = (((f64[t.charAt(i+2)]&amp;3)&lt;&lt;6) | (f64[t.charAt(i+3)]));
      i+=4;
    }
  <span class="reserved">if</span> (t.length%4 == 2)
    d = d.slice(0, d.length-2);
  <span class="reserved">if</span> (t.length%4 == 3)
    d = d.slice(0, d.length-1);
  <span class="reserved">return</span> d;
}

<span class="reserved">if</span> (typeof(atob) == <span class="literal">'undefined'</span> || typeof(btoa) == <span class="literal">'undefined'</span>)
  b64arrays();

<span class="reserved">if</span> (typeof(atob) == <span class="literal">'undefined'</span>) {
  atob = <span class="reserved">function</span>(s) {
    <span class="reserved">return</span> utf8d2t(b64t2d(s));
  }
}

<span class="reserved">if</span> (typeof(btoa) == <span class="literal">'undefined'</span>) {
  btoa = <span class="reserved">function</span>(s) {
    <span class="reserved">return</span> b64d2t(utf8t2d(s));
  }
}

<span class="reserved">function</span> cnonce(size) {
  var tab = <span class="literal">"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"</span>;
  var cnonce = <span class="literal">''</span>;
  <span class="reserved">for</span> (var i=0; i&lt;size; i++) {
    cnonce += tab.charAt(Math.round(Math.random(new Date().getTime())*(tab.length-1)));
  }
  <span class="reserved">return</span> cnonce;
}
</pre>
	<hr>



<!-- ========== START OF NAVBAR ========== -->
<a name="navbar_top"><!-- --></a>
<table border="0" width="100%" cellpadding="1" cellspacing="0">
<tr>
<td colspan=2 bgcolor="#EEEEFF" class="NavBarCell1">
<a name="navbar_top_firstrow"><!-- --></a>
<table border="0" cellpadding="0" cellspacing="3">
  <tr align="center" valign="top">
  
  
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-summary.html"><font class="NavBarFont1"><b>Overview</b></font></a>&nbsp;</td>
  <td bgcolor="#FFFFFF" class="NavBarCell1Rev">	&nbsp;<font class="NavBarFont1Rev"><b>File</b></font>&nbsp;</td>
  

  <td bgcolor="#FFFFFF" class="NavBarCell1"> <font class="NavBarFont1">Class</font>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-tree.html"><font class="NavBarFont1"><b>Tree</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="index-all.html"--><font class="NavBarFont1"><b>Index</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="help-doc.html"><font class="NavBarFont1"><b>Help</b></font></a>&nbsp;</td>
  </tr>
</table>
</td>
<td bgcolor="#EEEEFF" align="right" valign="top"><em>
<b>JSJaC</b></em>
</td>
</tr>

<tr>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
&nbsp;PREV&nbsp;
&nbsp;NEXT</font></td>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
  <a href="index.html" target="_top"><b>FRAMES</b></a>  &nbsp;
&nbsp;<a href="overview-summary.html" target="_top"><b>NO FRAMES</b></a>
&nbsp;&nbsp;
<script>
  <!--
  if(window==top) {
    document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
  }
  //-->
</script>
<noscript>
<a href="allclasses-noframe.html" target=""><b>All Classes</b></a>
</noscript>
</font></td>
</tr>
</table>
<!-- =========== END OF NAVBAR =========== -->

<hr>
<font size="-1">

</font>
<div class="jsdoc_ctime">Documentation generated by <a href="http://jsdoc.sourceforge.net/" target="_parent">JSDoc</a> on Tue Feb 12 18:46:55 2008</div>
</body>
</html>
